Translate
The Translate method tries to translate the specified source data to the specified value type.
ODTranslateResult Translate (in ODValueType fromType, in ODByteArray fromData, in ODValueType toType, out ODByteArray toData);
fromType
- The type of the source data to be translated.
fromData
- A byte array whose buffer contains the source data to be translated.
toType
- The type to which the source data is to be translated.
toData
- A byte array whose buffer is to contain the translated data.
- return value
- The result of the translation. The return value is one of the following:
kODCanTranslate
orkODCannotTranslate
.DISCUSSION
The return valuekODCanTranslate
indicates that translation is allowed with the specified type. The return valuekODCannotTranslate
indicates that translation is not allowed with the specified type.Your part calls this method after calling the
CanTranslate
method to establish that the source type is translatable. This method does not change the content of the source byte array.If translation is successful, this method allocates the destination byte array structure and its buffer, and stores the translated data in that buffer. It is your responsibility to deallocate the byte array structure (and its buffer) when it is no longer needed.
EXCEPTIONS
This method may throw platform-specific exceptions.
kODErrNoSysTranslationFacility
- The underlying system translation facility is not present.
kODErrOutOfMemory
- There is not enough memory to allocate the destination byte array structure (or its buffer).
SEE ALSO
TheODByteArray
type (page 877).
TheODTranslateResult
type (page 920).
TheODValueType
type (page 904).
TheODTranslation::CanTranslate
method (page 790).
Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help